# -*- coding: utf-8 -*-
import logging

from common.utils.decorator import sql_wrapper
from common.utils.db import list_object, get, upsert, delete
from common.feedback.model import Feedback

_LOGGER = logging.getLogger(__name__)


@sql_wrapper
def get_feedback(id):
    return get(Feedback, id)


@sql_wrapper
def upsert_feedback(info, id=None):
    return upsert(Feedback, info, id)


@sql_wrapper
def list_feedback(query_dct):
    return list_object(query_dct, Feedback)


@sql_wrapper
def delete_feedback(id):
    delete(Feedback, id)
